package com.chrray.position.controller.web;


import com.chrray.position.domain.FdAboutUs;
import com.chrray.position.domain.FdHomeAd;
import com.chrray.position.pojo.dto.BaseIdDto;
import com.chrray.position.pojo.dto.util.BaseAllDto;
import com.chrray.position.pojo.dto.web.FdHomeAdExe;
import com.chrray.position.service.web.WFdAboutUsService;
import com.chrray.position.service.web.WFdHomeAdService;
import com.chrray.position.util.result.PageBean;
import com.chrray.position.util.result.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import static com.chrray.position.util.result.ResponseResults.PAGE;
import static com.chrray.position.util.result.ResponseResults.success;

/**
 * 首页广告配置表控制器
 *
 * @author lm
 * @since 1.0.1 2024-09-02
 */
@RestController
@RequestMapping("/api/web/aboutUs")
@Api(tags = "关于我们")
@AllArgsConstructor
public class WFdAboutUsController {
    @Autowired
    private WFdAboutUsService wFdAboutUsService;


    @GetMapping("/selectOne")
    @ApiOperation("查询详情")
    @ApiResponses({
            @ApiResponse(code=200, message = "ok", response = FdAboutUs.class)
    })
    public ResponseResult<FdAboutUs> selectOne(BaseAllDto dto){
        return  success(wFdAboutUsService.selectOne());
    }

    @PostMapping("/save")
    @ApiOperation("保存")
    @ApiResponses({
            @ApiResponse(code=200, message = "ok", response = FdAboutUs.class)
    })
    public ResponseResult save(@RequestBody FdAboutUs entity){
        return  wFdAboutUsService.saveAboutUs(entity);
    }
}
